home *** CD-ROM | disk | FTP | other *** search
/ Directorty Opus 5 - Magellan / Opus 5 - Magellan.iso / Extras / D51_NUSource / Source / Routines / Unused / Window_Rows.s
Text File  |  1996-01-06  |  3KB  |  66 lines

  1. ;- By Leo 'Nudel' Davidson, 6-Jan-1996
  2. ;- Code for getting number of rows for Active window based on the 'C' source
  3. ;- to ReSize, ©1995 P.Marquardt.   I would have preferred to do this using the
  4. ;- AmigaANSI command sequence, but I couldn't work out how to use it.
  5.  
  6. ; Having written this I then realised that to write a routine to display the
  7. ; "Press any key to continue" message and then continue when the user presses
  8. ; a key couldn't be done without using the console device or some other thing.
  9. ; So I still need to use the damn thing -- I certainly don't feel like
  10. ; investigating how to use it just for this stupid help-text displaying routine,
  11. ; but if the console were used for the pause-prompt, it might as well be used
  12. ; to get the terminal rows, too, as that is a better method. All in all, I just
  13. ; with all this stuff could be done using the Input() and Output() handles, or
  14. ; with some new functions to talk _properly_ to your console without having to
  15. ; go to levels as low as talking to the console.device. Or have I been spoilt
  16. ; by the simplicity of other parts of the OS?... Hell, maybe these routines
  17. ; already exist or it's all really simple to do, in which case I wish I either
  18. ; had the documentation on how to do it, or the existing documentation pointed
  19. ; you in the direction of where the hell it is, because what I have points you
  20. ; around in circles to things which nearly do what I'm looking for, or things
  21. ; which describe bits of what I want to do but never explain how on Earth you
  22. ; actually use them....  God dammit, I just want to say FUCK!!!!!!!!!  Ahh,
  23. ; that's better, got that off my chest... Right, let's put on some load music
  24. ; (oh, there is already some on, okay) and code something else instead...
  25. ; People can just use nice, small fonts and huge overscan displays like I do,
  26. ; then the help text will fit on their screen anyway - so fukem.
  27.  
  28. ; If anyone can help me with this stuff, please email me
  29. ; leo.davidson@keble.oxford.ac.uk
  30.  
  31.     Sub.l    d0,d0            Lock entire structure (only option anyway).
  32.     N_CallInt LockIBase        Lock Intuition base.
  33. ;;;;;;;    d0 must be left alone as it contains pointer for unlock.
  34. ;;;;;;; No library calls should be made while intuition is locked, and it should
  35. ;;;;;;;    be unlocked ASAP.
  36.  
  37.     Move.l    N_IntBase(a5),a0    Point to Intuition base.
  38.     Move.l    ib_ActiveWindow(a0),a0    Point to Active Window.
  39.     Sub.w    d2,d2
  40.     Move.w    wd_Height(a0),d1    Height of window,
  41.     Move.b    wd_BorderTop(a0),d2    -._ Subtract
  42.     Sub.w    d2,d1            -'  BorderTop.
  43.     Move.b    wd_BorderBottom(a0),d2    -._ Subtract
  44.     Sub.w    d2,d1            -'  BorderBottom. -- Now have window height.
  45.  
  46.     Move.l    wd_RPort(a0),a0        Point to window's Rastport.
  47.     Move.l    rp_Font(a0),a0        Point to the textfont node.
  48.     Move.w    tf_YSize(a0),d2        Height of the font.
  49.  
  50.     Movem.w    d1/d2,-(SP)
  51.     Move.l    d0,a0            Lock to a0,
  52.     N_CallInt UnlockIBase        Unlock Intuition base.
  53.     Movem.w    (SP)+,d1/d2
  54.  
  55.     Divu.w    d2,d1            Divide window height by font height.
  56.     And.l    #$FFFF,d1        Clear remainder. -- Now have number of rows.
  57. ;-------------------------------------------------------------------------------------;
  58.     Lea    Buffer1(a5),a1        Output the number for testing.
  59. ;;;;;;;    Move.l    d1,d1
  60.     Bsr    N2A3Dig
  61.     Move.b    #10,(a1)
  62.  
  63.     Lea    Buffer1(a5),a0
  64.     Moveq    #4,d3
  65.     Bsr    CLIRite
  66.